﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;
namespace Demo01
{
    class StudentName : IComparer
    {
        public int Compare(object x, object y)
        {
            if (x is Student)
            {
                Student stuX = (Student)x;
                Student stuY = (Student)y;
                return stuX.Name.CompareTo(stuY.Name);
            }
            else
            {
                throw new Exception();
            }
        }
    }
}
